package epoch.game.core.buffer;

import epoch.game.core.netty.NettyBufferFactory;

public class BufferAllocator {
	
	static IBufferFactory factory = new NettyBufferFactory();
	
	public static IBufferFactory getFactory() {
		return factory;
	}
	
	public static void setFactory(IBufferFactory factory) {
		BufferAllocator.factory = factory;
	}

	public static IBuffer buffer(int initSize){
		return factory.buffer(initSize);
	}

	public static IBuffer buffer(){
		return factory.buffer();
	}

	public static IBuffer buffer(byte[] bytes){
		return factory.buffer(bytes);
	}
	
}
